package com.olympus.hermes.bean.dto.member;

import com.olympus.hermes.common.bean.AbstractBeanConvert;
import com.olympus.hermes.domain.Member;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.Instant;

/**
 * @author Mickey
 * @since 2021/2/1
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class OutputMemberDTO extends AbstractBeanConvert<OutputMemberDTO, Member> {

    private Instant createdAt;

    private String username;

    private String nickname;

    @Override
    protected Member doForward(OutputMemberDTO outputMemberDTO) {
        return null;
    }

    @Override
    protected OutputMemberDTO doBackward(Member member) {
        this.setUsername(member.getUsername());
        this.setNickname(member.getNickname());
        this.setCreatedAt(member.getCreatedAt());
        return this;
    }
}
